
## This script runs all the code files in the project.

## FIGURES
# Figure 1, 2: illustrative drawings, no code/data needed


# Figure 3
source("a1 Demographics Summary Stats.R")

# Figure 4, 5
source("a1 Recall Distributions.R")

## TABLES 
# Table 1: waterfall of obs numbers
source("a0 Obs Count.R")

# Table 2: summary statistics
source("a1 Recall Summary Stats.R")

# Table 3: correlation table
source("a2 Recall Correlation.R")

# Table 4: Cued recall, FreeRecall
source("b1 Return Cue Free.R")

# Table 5: Cued recall, ProbedRecall
source("b2 Return Cue Probed.R")

# Table 6: Simulation 
source("c1 Market Expectation.R")

# Table 7: Horse race
# Additional: Horse race between actual and recalled experience in explanatory power for beliefs of market crash probability
source("c2 Actual vs Recall.R")

# Table 8: R^2
source("c3 R2.R")

# Table 9: Anchoring 
source("c4 Anchoring.R") 

# Table 10: Testing order effects in simulation
source("c5 Order.R")

# Table 11 Expectations and future actions
source("c6 Expectations and Future Actions.R")

## APPENDIX

# Figure A.1 Distributions of survey respondents by hour and by day
# Figure A.2 Distribution of recalled market episodes in FreeRecall, by age group
source("app1 Survey Distribution.R")

# Figure A.3 Distribution of recalled episodes, alternative phrasing
source("app2 Additional Survey.R")

# Figure A.4
source("app3 Counterfactual Recall.R")

# Figure A.5, only in subsample of merged data, split by turnover
source("app4 Distribution of Recall.R")

# Figure A.6 Decomposition of recalled episode returns
# Figure A.7 Decomposition of recalled episode market returns
source("app5 Age Binscatter.R")

# Table A.1 Characteristics of the merged and unmerged sample
source("app6 Investor Chars.R")

# Table A.2 Investor characteristics in the merged sample
source("app7 Portfolio Summary Stats.R")

# Table A.3 Determinants of recalled episodes in FreeRecall
source("app8 Free Recall.R")

# Table A.4 Tests of cued recall in FreeRecall, robustness
source("b1 Return Cue Free.R")

# Table A.5: Cued recall in FreeRecall in an alternative survey
source("app2 Additional Survey.R")

# Table A.6 Tests of cued recall in FreeRecall
source("b1 Return Cue Free.R")

# Table A.7 Media cues and recalled experiences in FreeRecall and ProbedRecall
source("app9 Media.R")

# Table A.8 Horizon dependence, additional tests
source("app10 Horizon Dependence.R")

# Table A.9 Memory in FreeRecall and forecast errors
# Table A.10 Memory in ProbedRecall and forecast errors
source("app11 Forecast Errors.R")

# Table A.11: Relationship between recalls and beliefs, additional analysis
source("c1 Market Expectation.R")

# Table A.12: Summary statistics for respondents’ demographics in RandomOrder
source("c5 Order.R")

# Table A.13: Tests for cognitive defaults in simulation
source("app12 Cognitive Defaults.R")

# Table A.14: Past actions and recall
source("c6 Expectations and Future Actions.R")

## Online Appendix
# Figure A.1 is from model.m

